1. Field of the Invention
The present invention relates generally to a computer implemented method, data processing system, and computer program product for data communications. More specifically, the present invention relates to establishing a balance between the latency and efficiently processing data in a data processing system in one or more buffers.
2. Description of the Related Art
Computer systems frequently rely on network data connections to interoperate with other computers. Networked computers have been used in many architectures and business models. Data rates of common network elements are continuously being enhanced and redefined to meet new standards for speed and reliability. To satisfy higher data rate requirements, some computer architectures rely upon a network subsystem.
A network subsystem handles sessions, and more specifically, the packets that comprise the session. A packet is a series of bits that include at least a destination address and other header information as well as one or more bits in a payload. The packet may be located in various stages of transit. A packet can be in memory in preparation to transmit. A packet can be placed on a network medium. Alternatively, packet can be staged in memory within a receiving data processing system. A session is a flow of packets between two end-points on a network with attendant flow-control communications between the end-points. A network connection is the combination of one or more packets from one or more sessions. In other words, the network connection can be the undifferentiated stream of packets that are received or transmitted from a network interface card. These packets include those that are connectionless, unreliable, and unacknowledged. Accordingly, the network connection is the aggregate of all packets that touch the network interface during the duration that the network interface is active and/or available. The network connection may be made sub-divided into the network connection of received packets.
A network subsystem uses memory management facilities to provide readily available physical memory to buffer incoming and outgoing data streams. A unit of memory provided for this purpose is called an mbuf. An mbuf or memory buffer is used to store data in the kernel for incoming and outbound network traffic. Such memory always resides in physical memory and is never paged out.
A network service periodically needs to transport data. At this time, the network service can call an operating system mbuf allocator. An operating system mbuf allocator is a service that locks a pool of memory set aside for mbufs during a memory allocation operation. A buffer pool is one of one or more portions of memory set aside for networking operations. A call is an instruction and/or the act of a processor performing the instruction such that another block of code contains the next computer readable instruction. The operating system (OS) mbuf allocator then obtains at least one mbuf, and unlocks the pool. An example of an OS mbuf allocator is the m_get( ) function of the AIX® operating system. AIX is a registered trademark of IBM Corporation.
The m_get( ) operating system mbuf allocator obtains an mbuf from a previously created mbuf linked list. An mbuf linked list is a linked list of nodes. Each node is a combination of a buffer and a link or a link alone. The mbuf linked list contains a set of mbufs that are within a pool that is lockable by the OS mbuf allocator. The OS mbuf allocator locks the pool regardless of whether the service request is for one mbuf or for all mbufs in an mbuf linked list. In addition, obtaining the mbuf involves as much as seventy machine level instructions. A lock is one or more bits that are associated with a tract of physical memory or other shared resource. The lock exists as either locked or unlocked, depending on the content of the one or more bits.